<%@tag pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:if test="${fakeLoading != '1'}">

<c:set var="ctx" value="${pageContext.request.contextPath}" />

<script src="${ctx }/static/js/fakeLoader/js/fakeLoader.min.js"
	type="text/javascript"></script>
<link rel="stylesheet"
	href="${ctx }/static/js/fakeLoader/css/fakeLoader.min.css">
<script type="text/javascript">
	var loading = {};
	loading.showLoading = true;
	$(function() {
		$.ajaxSetup({
			beforeSend : function(evt, request, settings) {
				if (request && request.data && request.data.indexOf && request.data.indexOf("hideLoading=true")!= -1){
				}else{
					
						showLoading();
					
				}
			},
			complete : function() {
				hideLoading();
			}
		});
	})

	
	function showLoading() {
		if (!loading.showLoading ){
			return;
		}
		/**显示加载界面*/
		var $fakeLoader = $("#fakeLoader");
		if ($fakeLoader.data("loaded") !== true) {
			$fakeLoader.fakeLoader({
				bgColor : "#000",
				imagePath : "${ctx}/static/js/fakeLoader/aloading.gif"
			});
			$fakeLoader.data("loaded", true);
		} else {
			$fakeLoader.show();
		}
	}
	function hideLoading() {
		
		$("#fakeLoader").fadeOut();
	}
	
</script>
<div id="fakeLoader"></div>
<c:set var="fakeLoading" value="1" scope="request" />
</c:if>